<template>
    <div @click="handClick">
        demo测试页面
    </div>
</template>
<script>
import { onMounted, ref } from 'vue';
import request from '@/request/request';
export default {
    setup() {
        // 点击事件
        const handClick = () => {
            getData();
        }
        // 获取数据
        const getData = () => {
            const params = {
                url: "/index/index",
                method: "post",
                data: {
                    id: '1',
                },
                params: {
                    formKey: '2',
                },
            };
            request(params)
                .then((res) => {
                    console.log("res=", res);
                    if (res.code === 1) {
                    }
                })
                .catch(() => { })
                .finally(() => { });
        }

        onMounted(() => {
            getData();
        })
        return {
            handClick,
        }
    },
}
</script>
<style scoped></style>